package com.jz.banner.screen.utils

import android.os.Environment
import java.io.File

object ApkHelper {
    fun getDownloadApkCachePath(): String {

        var appCachePath: String? = null


        appCachePath = if (checkSDCard()) {
            Environment.getExternalStorageDirectory().toString() + "/sah-banner/"
        } else {
            Environment.getDataDirectory().path + "/sah-banner/"
        }
        val file = File(appCachePath)
        if (!file.exists()) {
            file.mkdirs()
        }
        return appCachePath
    }


    /**
     *
     */
    fun checkSDCard(): Boolean {

        return Environment.getExternalStorageState() == Environment.MEDIA_MOUNTED

    }
}